gdk: Remove gdk_device_get_axes()
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 28 Jul 2020 15:10:45 +0000 (17:10 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 28 Jul 2020 23:27:51 +0000 (01:27 +0200)
Besides the implicit x/y assumptions, devices don't have axes. Those
are actually provided by the GdkDeviceTool driving the device, and
different tools may have different axes.

It does not make sense to offer this API that can change beneath
someone's feet, we now have gdk_device_tool_get_axes() which is static
to the tool.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkdevice.c
gdk/gdkdevice.h
gdk/gdkdeviceprivate.h

index a863bae8576f0f261739c0c35f0b851fd07efba4..54038d480610e6c023bc97e99aca02d7703ddba8 100644 (file)
@@ -362,7 +362,6 @@ gdk_device_get_device_type
 gdk_device_get_display
 gdk_device_get_has_cursor
 gdk_device_get_n_axes
-gdk_device_get_axes
 gdk_device_get_seat
 gdk_device_get_num_touches
 gdk_device_get_device_tool
index 3a57c648602678437299c57f7ab0827d8b30bb80..bdb2799c05cca3dbd0a961ff12be990ed034b506 100644 (file)
@@ -95,7 +95,6 @@ enum {
   PROP_PRODUCT_ID,
   PROP_SEAT,
   PROP_NUM_TOUCHES,
-  PROP_AXES,
   PROP_TOOL,
   PROP_DIRECTION,
   PROP_HAS_BIDI_LAYOUTS,
@@ -265,17 +264,6 @@ gdk_device_class_init (GdkDeviceClass *klass)
                          0,
                          G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
                          G_PARAM_STATIC_STRINGS);
-  /**
-   * GdkDevice:axes:
-   *
-   * The axes currently available for this device.
-   */
-  device_props[PROP_AXES] =
-    g_param_spec_flags ("axes",
-                        P_("Axes"),
-                        P_("Axes"),
-                        GDK_TYPE_AXIS_FLAGS, 0,
-                        G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
 
   device_props[PROP_TOOL] =
     g_param_spec_object ("tool",
@@ -502,9 +490,6 @@ gdk_device_get_property (GObject    *object,
     case PROP_NUM_TOUCHES:
       g_value_set_uint (value, device->num_touches);
       break;
-    case PROP_AXES:
-      g_value_set_flags (value, device->axis_flags);
-      break;
     case PROP_TOOL:
       g_value_set_object (value, device->last_tool);
       break;
@@ -954,10 +939,7 @@ _gdk_device_reset_axes (GdkDevice *device)
   for (i = device->axes->len - 1; i >= 0; i--)
     g_array_remove_index (device->axes, i);
 
-  device->axis_flags = 0;
-
   g_object_notify_by_pspec (G_OBJECT (device), device_props[PROP_N_AXES]);
-  g_object_notify_by_pspec (G_OBJECT (device), device_props[PROP_AXES]);
 }
 
 guint
@@ -996,10 +978,7 @@ _gdk_device_add_axis (GdkDevice   *device,
   device->axes = g_array_append_val (device->axes, axis_info);
   pos = device->axes->len - 1;
 
-  device->axis_flags |= (1 << use);
-
   g_object_notify_by_pspec (G_OBJECT (device), device_props[PROP_N_AXES]);
-  g_object_notify_by_pspec (G_OBJECT (device), device_props[PROP_AXES]);
 
   return pos;
 }
@@ -1343,20 +1322,6 @@ gdk_device_get_seat (GdkDevice *device)
   return device->seat;
 }
 
-/**
- * gdk_device_get_axes:
- * @device: a #GdkDevice
- *
- * Returns the axes currently available on the device.
- **/
-GdkAxisFlags
-gdk_device_get_axes (GdkDevice *device)
-{
-  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
-
-  return device->axis_flags;
-}
-
 void
 gdk_device_update_tool (GdkDevice     *device,
                         GdkDeviceTool *tool)
index 5a369352b40d9c8a62c3efe1e93b793b06e070a9..0b2482ef747f52a80082501461b573b8ae15fef9 100644 (file)
@@ -142,9 +142,6 @@ const char *gdk_device_get_product_id      (GdkDevice *device);
 GDK_AVAILABLE_IN_ALL
 GdkSeat     *gdk_device_get_seat            (GdkDevice *device);
 
-GDK_AVAILABLE_IN_ALL
-GdkAxisFlags gdk_device_get_axes            (GdkDevice *device);
-
 GDK_AVAILABLE_IN_ALL
 guint           gdk_device_get_num_touches  (GdkDevice *device);
 
index 93c7b7a558233be64e8ba3768b0e15656261c23d..04263b241657d93f4fbf20361e8b1ef322ccf6fa 100644 (file)
@@ -39,7 +39,6 @@ struct _GdkDevice
   char *name;
   GdkInputSource source;
   gboolean has_cursor;
-  GdkAxisFlags axis_flags;
   GdkDeviceType type;
   GdkDisplay *display;
   /* The paired logical device for logical devices,